<?php
$test = db_get_list_post_in_post_type_nopage_metakey(2, 'testimonial', 'date', 'DESC', $wpdb->prefix.'display', 'display');
query_posts($test); 
?>
<div id="after-mid">
    <span class="top"></span>
    <div class="center">
    <span class="title-box">Testimonials</span>
    <a href="<?php bloginfo('home');?>/testimonials" class="view-all">{ View All }</a>
    <ul>
    <?php
    if(have_posts())
    {
    	$image_rs = new SimpleImage();
    	while (have_posts())
    	{
    		the_post();
    		$postID = get_the_ID();
			$title = get_the_title($postID);
			$perlink = get_permalink($postID);
			$alt = db_vietnamese_slug($title);
			$thumbnail = db_get_post_meta($postID, $wpdb->prefix.'thumbnail');
			if($thumbnail)
				$thumbnail = db_resizeImage($image_rs, $thumbnail, 115, 94);
    		?>
    		<li>
	        	<div class="box-img">
	            	<img alt="<?php echo $alt;?>" src="<?php echo $thumbnail?>" />
	            </div>
	            
	            <div class="box-info">
	            	<span class="top-info"></span>
	                	<p>
	                	<?php echo db_shortDesc(get_the_content(), 100);?>
						</p>
	                    <a href="<?php echo $perlink;?>" class="details">Details</a>
	                <span class="bottom-info"></span>
	            </div>
	        </li>    		
    		<?php 
    	}
    	wp_reset_query();
    	unset($image_rs);
    } 
    else 
    {
    	echo '<li> No Post!. </li>';
    }
    ?>
    </ul>
    </div>
    <span class="bottom"></span>
    </div>